<%@ page language="java" import="java.util.*,dao.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE HTML>
<!--[if lt IE 7 ]> <html lang="en" class="ie6 ielt9"> <![endif]-->
<!--[if IE 7 ]> <html lang="en" class="ie7 ielt9"> <![endif]-->
<!--[if IE 8 ]> <html lang="en" class="ie8 ielt9"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!-->
<html lang="en">
<!--<![endif]-->

<link type="text/css" rel="stylesheet"
	href="/products/passport/v2/css/base.css" />
<link type="text/css" rel="stylesheet"
	href="/products/passport/v2/css/register.css" />
<link rel="stylesheet" type="text/css" href="/products/css/myself.css" />
<link rel="stylesheet" type="text/css" href="/products/css/myupload.css" />


<link rel='stylesheet' id='dt-custom.less-css'
	href='/products/css/custom.css' type='text/css' media='all' />
<%@ include file="head.jsp"%>
<style type="text/css">
.CusSetting {
	position: absolute;
	left: 45%;
	top: 25%;
	width: 20%;
	height: 160px;
	background-color: rgb(200, 230, 255);
	display: none;
	font-family: "宋体";
	font-size: 14px;
	color: #555;
}

.chenggong {
	height: 16px;
}
</style>

<body style="min-width: 980px;">

	<div id="modifyPwd" class="CusSetting" style="font-size: 12px;">
		<!-- 		<div class="tips_thanks" style="margin: 2px;line-height: inherit;">修改密码:</div> -->




		<div style="margin: 10px;">
			旧密码:<input type="password" style="width: 30%" />
		</div>
		<div style="margin: 10px;">
			新密码:<input type="password" style="width: 30%" maxlength="16" />
		</div>
		<div>
			<input type="button" class="btn_11" value="点击立即设置新密码"
				style="padding-right: 50px;position: absolute;bottom: 5%;left: 20%;cursor: pointer;font-weight: 800;font-size: 14px;">
		</div>
	</div>



	<div id="setSecretEmail" class="CusSetting">
		<div class="tips_thanks" style="margin: 2px;line-height: inherit;">设置密保邮箱:</div>
		<div>
			<input type="text" />
		</div>
		<div>
			<input type="submit" class="btn_11" value="点击立即发送邮件"
				style="padding-right: 50px;position: absolute;bottom: 5%;left: 20%;cursor: pointer;font-weight: 800;font-size: 14px;">
		</div>
	</div>

	<div id="EmailSecretSteptwo"
		style="background-color: wheat;position: absolute;left: 40%;top: 20%;display: none;">
		<div class="tablebox">
			<input type="hidden" name="user" id="useraccount"
				value="${secondStep }" />
			<!--验证邮箱-->
			<p class="tips_thanks" style="background-color: rgb(200, 230, 255);">还差一步就完成密保邮箱设置了</p>
			<p style="background-color: rgb(200, 230, 255);padding: 0 5% 0  5%"
				id="secretEmailMsg">为保护您的邮箱账号不被他人使用，我们已经给您的邮箱${secondStep }发送了一封确认邮件，请在收到邮件后，点击邮件中的密保邮箱激活的确认链接即可。</p>
			<p class="btnReSend"
				style="background-color: rgb(200, 230, 255);margin: 0">
				<a href="#" target="_blank" style="margin: 10px;"
					id="configSecretEmail" class="btn_11"><span>立即去我的邮箱确认</span></a>
			</p>
		</div>
	</div>
	<div style="min-height: 65%">
		<div class="c_box nobg" style="min-width: 400px;margin-left: 20%">
			<div style="float:left;width: 80px;">
				<button onclick="showUserMsg()"
					style="background-color: rgb(0, 153, 255);cursor: pointer;">个人资料</button>
				<button onclick="showRealMsg()"
					style="background-color: rgb(0, 153, 255);cursor: pointer;">实名认证</button>
				<button onclick="showPwdMsg()"
					style="background-color: rgb(0, 153, 255);cursor: pointer;">账户安全</button>
			</div>

			<div class="left" style="float: left">
				<img id="face" title="" alt="" width="92px;" height="92px;"
					src="/products/avatar/${user.avatar}">

				<div class="box" style="margin-left: 43px;">
					<form action="uploadAvatar" enctype="multipart/form-data"
						id="uploadAvatarForm" method="post"
						onchange="return uploadAvatar();">
						<a href="javascript:void(0);" class="link"
							style="color: white;text-align: center;width: 100%;cursor: pointer;padding: 0;width: 92px;height: 30px;">浏览</a>
						<input style="left:0px;cursor: pointer;width: 92px;height: 30px;"
							type="file" class="uploadFile" name="avatar" />
					</form>
				</div>
			</div>
			<div class="right" style="float: left;">
				<table>
					<thead>
					</thead>
					<tbody id="userMsg">
						<tr style="height: 30px;"></tr>
						<tr>
							<td class="tdName1">账 户：</td>
							<td class="td2 account_box" style="width: 300px;">${user.userAcc }</td>

						</tr>
						<tr>
							<td class="tdName1">昵 称：</td>
							<td class="td2 account_box" style="width:200px;"><input
								type="text" id="editAccName" name="editAccName" maxlength="15"
								style="width: 200px;color: black;" value="${user.nickName}"></td>
							<td><a class="info_entry" style="display: inline-block;"
								href="javascript:void(0)" id="editAccNameBtn">修改昵称</a></td>
							<td><span id="editAccNameTip"></span></td>
						</tr>
						<tr>
							<td class="tdName1">绑定手机：</td>
							<td class="td2 account_box" style="width:300px;">${user.phone }</td>
						</tr>
						<tr>
							<td class="tdName1">绑定邮箱：</td>
							<td class="td2 account_box" style="width:300px;">${user.mail }</td>
						</tr>
					</tbody>
					<tbody id="realMsg" style="display: none">
						<tr style="height: 30px;"></tr>
						<tr>
							<td class="tdName1">真实姓名：</td>
							<td class="td2 account_box" style="width:200px;">${user.trueName}</td>
						</tr>
						<tr>
							<td class="tdName1">身份证号码：</td>
							<td class="td2 account_box" style="width:200px;">${user.idNumber}</td>
						</tr>
					</tbody>
					<tbody id="pwdMsg" style="display: none">
						<tr style="height: 30px;"></tr>
						<tr>
							<td class="tdName1">密 码：</td>
							<td class="td2 account_box" style="width:300px;">********</td>
							<td><a class="info_entry" style="display: inline-block;"
								href="javascript:void(0)" id="modifyPwdBtn">修改密码</a></td>
						</tr>
						<tr id="oldPwdTr" style="display: none">
							<td class="tdName1">旧 密 码：</td>
							<td class="td2 account_box" style="width:200px;"><input
								type="password" maxlength="15" id="oldPwd" name="oldPwd"
								maxlength="16" style="width: 100px;"><span
								id="oldPwdTip"></span></td>
						</tr>
						<tr id="newPwdTr" style="display: none">
							<td class="tdName1">新 密 码：</td>
							<td class="td2 account_box" style="width:200px;"><input
								type="password" id="newPwd" name="newPwd" maxlength="16"
								style="width: 100px;"><span id="newPwdTip"></span></td>
						</tr>
						<tr id="newPwdRepTr" style="display: none">
							<td class="tdName1">重复新密码：</td>
							<td class="td2 account_box" style="width:200px;"><input
								type="password" id="newPwdRep" name="newPwdRep" maxlength="16"
								style="width: 100px;"><span id="newPwdRepTip"></span></td>
							<td><a class="info_entry" style="display: inline-block;"
								href="javascript:void(0)" id="modifyPwdCfr">保存</a></td>
						</tr>
						<tr>
							<td class="tdName1">密保手机：</td>
							<td class="td2 account_box" style="width:300px;">${user.phone}</td>
							<c:if test="${empty user.phone }">
								<td><a class="info_entry" style="display: inline-block;"
									id="setsecretPhone" href="javascript:void(0)">设置密保手机</a></td>
							</c:if>
							<c:if test="${!empty user.phone }">
								<td><a class="info_entry" style="display: inline-block;"
									id="setsecretPhone" href="javascript:void(0)">修改密保手机</a></td>
							</c:if>
						</tr>
						<tr id="phoneTr" style="display: none">
							<td class="tdName1">手机号码：</td>
							<td class="td2 account_box" style="width:200px;"><input
								type="text" id="phone" name="phone" maxlength="11"
								style="width: 100px;color: black"><span id="phoneTip"></span></td>
						</tr>
						<tr id="phoneCodeTr" style="display: none">
							<td class="tdName1">短信验证码：</td>
							<td class="td2 account_box" style="width:300px;"><input
								type="text" id="vcode" name="vcode" maxlength="6"
								style="width: 100px;"> <input type="button"
								id="sms_code_btn" value="获取验证码" class="txtCenter getVali"
								style="position: static;display: inline;color: black"> <span
								id="vcodeTip"></span></td>

							<td><a class="info_entry" style="display: inline-block;"
								href="javascript:void(0)" id="setPhoneCfr">保存</a></td>
						</tr>
						<tr>
							<td class="tdName1">绑定邮箱：</td>
							<c:if test="${!empty user.mail}">
								<td class="td2 account_box" style="width:300px;">${user.mail}</td>
								<td><a class="info_entry" style="display: inline-block;"
									href="javascript:void(0)" id="showSecretEmailTrBtn">设置密保邮箱</a></td>
							</c:if>
							<c:if test="${empty user.mail }">
								<td class="td2 account_box" style="width:200px;">&nbsp;</td>
								<td><a class="info_entry" style="display: inline-block;"
									href="javascript:void(0)"  id="showSecretEmailTrBtn">设置密保邮箱</a></td>
							</c:if>
						</tr>
						<tr  id="showSecretEmailTr" style="display: none;">
							<td class="tdName1">请输入邮箱：</td>
							<td colspan="2">
								<form id="secretEmailForm" action="secretEmailForm" 
									method="POST" onsubmit="return secretSubmit();">
									<input type="text" id="secretEmail" name="secretEmail"
										style="width: 200px;"> <span id="secretEmailTip"></span>
										<input type="submit" class="info_entry"
								style="display: inline-block;float: right;cursor: pointer;padding: 6px 0 7px 0;text-align: center;height: 30px;font-size: 12px;color: black;"
								id="sendSecretEmail" value="发送激活邮件">
								</form></td>
						</tr>
						<c:if test="${empty user.question1 }">
							<tr>
								<td class="tdName1">密保问题</td>
								<td class="td2 account_box" style="width:300px;"></td>
								<td><a class="info_entry" style="display: inline-block;"
									id="showQuestions" href="javascript:void(0)">设置密保问题</a></td>
							</tr>
							<tr id="question1Tr" style="display: none">
								<td class="tdName1">密保问题1：
								<td class="tdName1" style="padding-left: 0"><select
									id="question1" style="margin: 0;width: 206px;margin-left: 6px;"
									name="question1">
										<c:forEach items="${codeValues}" var="codeValue">
											<option value="${codeValue.id.value }">${codeValue.id.value }</option>
										</c:forEach>
								</select></td>
							</tr>
							<tr id="answer1Tr" style="display: none">
								<td class="tdName1"></td>
								<td class="td2 account_box" style="width:200px;"><input
									type="text" maxlength="40" id="answer1" name="answer1"
									style="width: 200px;"></td>
							</tr>
							<tr id="question2Tr" style="display: none">
								<td class="tdName1">密保问题2：
								<td class="tdName1" style="padding-left: 0"><select
									id="question2" style="margin: 0;width: 206px;margin-left: 6px;"
									name="question2">
										<c:forEach items="${codeValues}" var="codeValue">
											<option value="${codeValue.id.value }">${codeValue.id.value }</option>
										</c:forEach>
								</select></td>
							</tr>
							<tr id="answer2Tr" style="display: none">
								<td class="tdName1"></td>
								<td class="td2 account_box" style="width:200px;"><input
									type="text" maxlength="40" id="answer2" name="answer2"
									style="width: 200px;"></td>
							</tr>
							<tr id="question3Tr" style="display: none">
								<td class="tdName1">密保问题3：
								<td class="tdName1" style="padding-left: 0"><select
									id="question3" style="margin: 0;width: 206px;margin-left: 6px;"
									name="question3">
										<c:forEach items="${codeValues}" var="codeValue">
											<option value="${codeValue.id.value }">${codeValue.id.value }</option>
										</c:forEach>
								</select></td>
							</tr>
							<tr id="answer3Tr" style="display: none">
								<td class="tdName1"></td>
								<td class="td2 account_box" style="width:200px;"><input
									type="text" maxlength="40" id="answer3" name="answer3"
									style="width: 200px;"></td>
								<td><a class="info_entry" style="display: inline-block;"
									id="secretQuestionSubmit" href="javascript:void(0)">保存</a></td>
							</tr>
						</c:if>
						<c:if test="${!empty user.question1 }">
							<tr>
								<td class="tdName1">密保问题1：</td>
								<td class="td2 account_box" style="width:200px;">${user.question1}</td>
							</tr>
							<tr>
								<td class="tdName1">密保答案1：</td>
								<td class="td2 account_box" style="width:200px;">********</td>
							</tr>
							<tr>
							<tr>
								<td class="tdName1">密保问题2：</td>
								<td class="td2 account_box" style="width:200px;">${user.question2}</td>
							</tr>
							<tr>
								<td class="tdName1">密保答案2：</td>
								<td class="td2 account_box" style="width:200px;">********</td>
							</tr>
							<tr>
								<td class="tdName1">密保问题3：</td>
								<td class="td2 account_box" style="width:200px;">${user.question3}</td>
							</tr>
							<tr>
								<td class="tdName1">密保答案3：</td>
								<td class="td2 account_box" style="width:200px;">********</td>
							</tr>
						</c:if>
					</tbody>
				</table>
			</div>
		</div>
	</div>
	<%@ include file="footer.jsp"%>
	<script type="text/javascript" src="/products/js/jquery142.js"></script>
	<script type="text/javascript" src="/products/js/jqueryFormMin.js"></script>
	<script type="text/javascript"
		src="/products/passport/v2/js/formValidator413.js"></script>
	<!--[if lt IE 7 ]>
<script type="text/javascript">
$(document).ready(function(){
  $("li:first-child").addClass("first-child");
});
</script>
<![endif]-->
	<script type="text/javascript">
		var smsCode = false;
		var emailCode = false;
		(function($) {
			$.fn.slide = function(options) {
				var obj = $(this);
				var objBar = $(options.slideBar, $(this));
				var objContent = $(options.slideContent, $(this));
				var timeOut = options.step;
				var maxNum = $(objContent).size();
				var curID = 0;
				var autoSlide;
				var picID = 0;
				$(objContent).hide();
				$(objContent).eq(0).show();
				$(objBar).removeClass("current");
				$(objBar).eq(0).addClass("current");
				autoScrolll();
				$(objContent).hover(function() {
					StopScrolll();
				}, function() {
					autoScrolll();
				});
				$(objBar).hover(function() {
					StopScrolll();
					picID = $(this).index();
					if (picID >= maxNum)
						return;
					if (picID != curID) {
						$(objContent).removeClass("current");
						$(objBar).removeClass("current");
						$(objContent).eq(picID).addClass("current");
						$(objBar).eq(picID).addClass("current");
						$(objContent).eq(picID).fadeIn(1000);
						$(objContent).eq(curID).fadeOut(500);
						curID = picID;
					}
				}, function() {
					autoScrolll();
				});
				$(objBar).click(function() {
					StopScrolll();
				});
				function autoScroll() {
					curID++;
					curID = curID >= maxNum ? 0 : curID;
					if ($(objContent).filter(":visible").index() != curID) {
						$(objContent).removeClass("current");
						$(objBar).removeClass("current");
						$(objContent).eq(curID).addClass("current");
						$(objBar).eq(curID).addClass("current");
						$(objContent).filter(":visible").fadeOut(500).parent()
								.children().eq(curID).fadeIn(1000);
					}
				}
				function autoScrolll() {
					autoSlide = setInterval(autoScroll, timeOut);
				}
				function StopScrolll() {
					clearInterval(autoSlide);
				}
			};
			$.fn.adFixed = function(btn, sTop) {
				var adBar = $(this);
				var screen_w = screen.width;
				if (screen_w > 1024) {
					adBar.show();
				} else {
					adBar.hide();
				}
				;
				var m = parseInt(adBar.css('top'));
				$(window).scroll(function() {
					var scrollTop = $(window).scrollTop();
					if (scrollTop > (m)) {
						adBar.stop().animate({
							top : scrollTop + sTop
						});
					} else {
						adBar.stop().animate({
							top : m
						});
					}
				});
				btn.click(function() {
					$(this).parent().hide();
					return false;
				});
			};

		})(jQuery);
		$(document).ready(
				function() {
					$("#slider").slide({
						slideBar : ".sliderBar > li",
						slideContent : ".sliderCont > li",
						step : 4000
					});
					$(".adFixed").adFixed($(".btnClose"), 30);
					$("#setSecretEmailBtn").click(function() {
						$("#setSecretEmail").hide();
						$("#EmailSecretSteptwo").show();
						return false;
					});
					$("#addSecretEmail").click(function() {
						$("#setSecretEmail").show();
						return false;
					});
					$("#showQuestions").click(function() {
						$("#question1Tr").show();
						$("#question2Tr").show();
						$("#question3Tr").show();
						$("#answer1Tr").show();
						$("#answer2Tr").show();
						$("#answer3Tr").show();
					});
					$("#editAccName").attr("readonly", "readonly");
					$("#editAccNameBtn").toggle(function() {
						$("#editAccNameBtn").text("保存");
						$("#editAccNameTip").css("color", "");
						$("#editAccName").removeAttr("readonly");
						$("#editAccName").focus();
						$("#editAccName").select();
					}, function() {
						$.ajax({
							url : "/products/modifyNickname",
							async : false,
							cache : false,
							data : {
								"nickname" : $("#editAccName").val()
							},
							dataType : "json",
							type : 'POST',
							success : function() {
								location.reload();
							}
						});
						$("#editAccNameBtn").text("修改昵称");
						$("#editAccName").attr("readonly", "readonly");
						$("#editAccNameTip").css("color", "");
						$("#editAccNameTip").text("");

					});
					$("#modifyPwdBtn").click(function() {
						$("#oldPwd").val("");
						$("#oldPwdTip").css("color", "");
						$("#newPwd").val("");
						$("#newPwdTip").css("color", "");
						$("#oldPwdTr").show();
						$("#newPwdTr").show();
						$("#newPwdRepTr").show();
						return false;
					});
					$("#oldPwd").blur(function() {
						$.ajax({
							url : "/products/checkoldpwd",
							async : false,
							cache : false,
							data : {
								"oldPwd" : $("#oldPwd").val()
							},
							dataType : "text",
							type : 'POST',
							success : function(msg) {
								if ("success" == msg) {
									$("#oldPwdTip").text("OK");
									$("#oldPwdTip").css("color", "green");
								} else {
									$("#oldPwdTip").text("旧密码错误");
									$("#oldPwdTip").css("color", "red");
									$("#oldPwd").focus();
									$("#oldPwd").select();
								}
							}
						});
					});
					$("#newPwd").focus(function() {
						$("#newPwdTip").text("请填写6-18位任意字符,区分大小写");
					});
					$("#newPwd").blur(function() {
						if (!/^.{6,}$/.test($("#newPwd").val())) {
							$("#newPwdTip").text("密码不能小于6位");
							$("#newPwdTip").css("color", "red");
							$("#newPwd").focus();
							$("#newPwd").select();
						} else {
							$("#newPwdTip").text("OK");
							$("#newPwdTip").css("color", "green");
						}
					});
					$("#newPwdRep").blur(function() {
						if ($("#newPwd").val() != $("#newPwdRep").val()) {
							$("#newPwdRepTip").text("两次密码不一致");
							$("#newPwdRepTip").css("color", "red");
						} else {
							$("#newPwdRepTip").text("OK");
							$("#newPwdRepTip").css("color", "green");
						}
					})
					$("#modifyPwdCfr").click(function() {
						if ($("#oldPwd").val() == "") {
							$("#oldPwdTip").text("请输入旧密码");
							$("#oldPwdTip").css("color", "red");
							return;
						}
						if ($("#newPwd").val() == "") {
							$("#newPwdTip").text("请输入新密码");
							$("#newPwdTip").css("color", "red");
							return;
						}
						if ($("#newPwd").val() != $("#newPwdRep").val()) {
							$("#newPwdRepTip").text("两次密码不一致");
							$("#newPwdRepTip").css("color", "red");
							return;
						}
						$.ajax({
							url : "/products/setnewpwd",
							async : false,
							cache : false,
							data : {
								"newPwd" : $("#newPwd").val()
							},
							dataType : "text",
							type : 'POST',
							success : function(msg) {
								if ("success" == msg) {
									$("#newOldTr").hide();
									$("#newPwdTr").hide();
									$("#newPwdRepTr").hide();
									location.reload();
								} else {
									alert("密码修改失败");
								}
							}
						});
					});

					$("div:first").nextAll().not('#modifyPwd').click(
							function() {
								$("#modifyPwd").hide();
							});
					$("div:first").nextAll().not('#secretEmailForm').click(
							function() {
								$("#setSecretEmail").hide();
							});
					$("div:first").nextAll().not('#EmailSecretSteptwo').click(
							function() {
								$("#EmailSecretSteptwo").hide();
							});

				});

		$.formValidator.initConfig({
			errorFocus : false,
			formID : "secretEmailForm",
			submitOnce : true,
			forcevalid : false,
			errorfocus : false,
			buttonID : "sendSecretEmail"
		});
		$("#secretEmail").formValidator({
			onFocus : tips.emailSecret.f
		}).inputValidator({
			empty : {
				leftEmpty : false,
				rightEmpty : false,
				emptyError : tips.emailSecret.err_kongge
			}
		}).regexValidator({
			regExp : "email",
			dataType : "enum",
			onError : tips.account.err,
			onErrorEmpty : tips.emailSecret.err_null
		});

		function secretSubmit() {
			if ($("#secretEmail").val() == "") {
				return;
			}
			$("#secretEmailForm")
					.ajaxSubmit(
							function(message) {
								if (message != null && message != "") {
									$("#secretEmailMsg")
											.html(
													"为保护您的邮箱账号不被他人使用，我们已经给您的邮箱"
															+ $("#secretEmail")
																	.val()
															+ "发送了一封确认邮件，请在收到邮件后，点击邮件中的密保邮箱激活的确认链接即可。");
									$("#configSecretEmail").attr("href",
											"http://mail." + message + ".com");
									$("#setSecretEmail").hide();
									$("#EmailSecretSteptwo").show();
									return false;
								}
							});
			return false;
		}
		$("#secretQuestionSubmit").click(function() {
			if ($("#answer1").val() == "") {
				alert("密保答案1不能为空");
				return;
			}
			if ($("#answer2").val() == "") {
				alert("密保答案2不能为空");
				return;
			}
			if ($("#answer3").val() == "") {
				alert("密保答案3不能为空");
				return;
			}
			$.ajax({
				url : "/products/secretQuestionForm",
				async : false,
				cache : false,
				data : {
					"question1" : $("#question1").val(),
					"question2" : $("#question2").val(),
					"question3" : $("#question3").val(),
					"answer1" : $("#answer1").val(),
					"answer2" : $("#answer2").val(),
					"answer3" : $("#answer3").val(),
				},
				dataType : "text",
				type : 'POST',
				success : function(msg) {
					location.reload();
				}
			});
		});
		function uploadAvatar() {
			$("#uploadAvatarForm").ajaxSubmit(function(msg) {
				if ("success" == msg) {
					location.reload();
				}
				if ("errorType" == msg) {
					alert("请上传正确的图片文件");
				}
				if ("errorSize" == msg) {
					alert("图片不能超过2M");
				}
			});
			return false;
		}
		$("#phone")
				.blur(
						function() {
							var reg = /^(^1[38][0-9]{9}$)|(^15[012356789][0-9]{8}$)|(^14[57][0-9]{8}|17[0678][0-9]{8}$)/;
							if (reg.test($("#phone").val())) {
								$("#phoneTip").css("color", "green");
								$("#phoneTip").text("OK");
							} else {
								$("#phoneTip").css("color", "red");
								$("#phoneTip").text("手机号码格式不正确");
							}
						});
		$("#setsecretPhone").click(function() {
			$("#phoneTr").show();
			$("#phoneCodeTr").show();
		});
		$("#sms_code_btn")
				.click(
						function() {
							//kztype="fsyzm phone reg useraccount"
							var phone = $("#phone").val();
							if (phone != "") {
								if ($("#phoneCodeTip").find(".info_cur_erro").length > 0) {
									return false;
								}

								var phone = $("#phone").val();
								//异步发送
								$
										.ajax({
											type : 'get',
											url : "/products/regsmscode?t="
													+ Math.random(),
											data : {
												type : 2,
												phone : phone
											},
											dataType : 'text',
											success : function(result) {
												switch (result) {
												case "4085": {
													$.formValidator
															.showTips(
																	$("#useraccountTip"),
																	"err",
																	"短信验证码每个手机号码每天只能发送10条");
												}
													break;
												case "success": {
													var obj = $("#sms_code_btn");
													obj.attr("disabled",
															"disabled").attr(
															"send", "ok");
													obj.val("(59秒)后重新获取");
													var s = 58;
													var Interval = setInterval(
															function() {

																obj
																		.val("("
																				+ s
																				+ "秒)后重新获取");
																s--;
																if (s == 0) {
																	obj
																			.val(
																					"重新获取验证码")
																			.removeAttr(
																					"disabled");
																	clearInterval(Interval);
																}
															}, 1000);
													$.formValidator
															.showTips(
																	$("#vcodeTip"),
																	"focus",
																	"短信验证码已发送");
												}
													break;
												}
											},
											error : function() {
												// 												$.KzShowForm.removeBox();
												$.formValidator.showTips(
														$("#vcodeTip"), "err",
														tips.smscode.err_send);
											}
										});

							} else {
								$.formValidator.showTips($("#useraccountTip"),
										"err", tips.phone.err_null);
								return false;
							}
						});
		$("#vcode").formValidator({
			onFocus : function() {
				if ($("#sms_code_btn").attr("send")) {
					return tips.smscode.f_after;
				} else {
					return tips.smscode.f_befor;
				}
			}
		}).inputValidator({
			min : 6,
			max : 6,
			onError : tips.smscode.err,
			onErrorEmpty : tips.smscode.err_null
		}).ajaxValidator({
			url : "/products/checksmscode",
			dataType : "text",
			async : false,
			data : {
				"phone" : function() {
					return $("#useraccount").val();
				},
				"code" : function() {
					return $("#vcode").val();
				},
				"type" : "secretPhone"
			},
			success : function(data) {
				if (data != "1") {
					smsCode = false;
					return tips.smscode.err;
				}
				smsCode = true;
				return true;
			},
			onError : tips.smscode.err
		});
		$("#setPhoneCfr").click(function() {
			if (smsCode == true) {
				$.ajax({
					url : "/products/setSecretPhoneCfr",
					async : false,
					cache : false,
					data : {
						"phone" : $("#phone").val()
					},
					dataType : "text",
					type : 'POST',
					success : function(msg) {
						location.reload();
					}
				});
			} else {
				return;
			}
		});
		$("#showSecretEmailTrBtn").click(function(){
			$("#showSecretEmailTr").show();
		});
		function showUserMsg() {
			$("#userMsg").show();
			$("#realMsg").hide();
			$("#pwdMsg").hide();
		}
		function showRealMsg() {
			$("#userMsg").hide();
			$("#realMsg").show();
			$("#pwdMsg").hide();
		}
		function showPwdMsg() {
			$("#userMsg").hide();
			$("#realMsg").hide();
			$("#pwdMsg").show();
		}
	</script>
	<div style="display:none">
		<script type="text/javascript">
			var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://"
					: " http://");
			document
					.write(unescape("%3Cscript src='"
							+ _bdhmProtocol
							+ "hm.baidu.com/h.js%3F1287c2225a527abe3386233dd9316f99' type='text/javascript'%3E%3C/script%3E"));
		</script>
		<script type="text/javascript" src="/products/refer.js"></script>
	</div>

</body>

</html>